package com.example.managedbeans;
import java.io.Serializable;  
import java.util.ArrayList;  
import java.util.List;  



import com.example.entities.Project;
import com.example.service.ProjectHandler;
  

  
public class TestBean implements Serializable {  
      
    
  
 
      
    private List<Project> projectList;  
    
    public List<Project> getProjectList() {  
        return projectList;  
    }
      
    public TestBean() {  
        projectList = new ArrayList<Project>();  
          
        populateRandomCars(projectList, 9);  
    }  
      
    private void populateRandomCars(List<Project> list, int size) {  
    	
    	Project p = new Project();
    	p.setProjectName("cloud");
    	p.setDescription("cloud");
    	p.setDuration("48");
        list.add(p); 
    }  
      
	public String getAllProjects()
	{
		ProjectHandler ph = new ProjectHandler();
//		//projectList.clear();	
		projectList = ph.getAllProjects();
		return "true";		
	}
}  